/***********************************************************************************************//**
 * \file   app-callback.c
 * \brief  Callbacks related to Application
 ***************************************************************************************************
 * <b> (C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>
 ***************************************************************************************************
 * This file is licensed under the Silabs License Agreement. See the file
 * "Silabs_License_Agreement.txt" for details. Before using this software for
 * any purpose, you must agree to the terms of that agreement.
 **************************************************************************************************/

#include CONFIGURATION_HEADER


#if !defined HOST && (defined SILABS_AF_PLUGIN_CABLE_SERVER || defined SILABS_AF_PLUGIN_CABLE_CLIENT)
/* standard library headers */
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>

/* serial retarget for cable replacement */
#include "retargetserial.h"
#include "app_ui.h"
#endif /* !defined HOST && (defined SILABS_AF_PLUGIN_CABLE_SERVER || defined SILABS_AF_PLUGIN_CABLE_CLIENT) */

/* Own header*/
#include "app-callback.h"

/***************************************************************************************************
  Local Macros and Definitions
***************************************************************************************************/
/* Text definitions */
#define CABLE_CLIENT_TEXT               "\nCable Replacement\n\nClient\n"


/***************************************************************************************************
 Function Definitions
 **************************************************************************************************/

void resetEventCallback(void)
{
#if !defined HOST && defined SILABS_AF_PLUGIN_CABLE_SERVER
  /* Send diagnostic data to serial port in ASCII - System has booted */
  printf("\n*** System boot ***\n\n");
  printf("Cable replacement demo started\n");
  printf("Terminal input and output connected to the following characteristic \n");
  printf("UUID: e7add780-b042-4876-aae1-112855353cc1 \n\n");
#endif /* !defined HOST && defined SILABS_AF_PLUGIN_CABLE_SERVER */

#if !defined HOST && defined SILABS_AF_PLUGIN_CABLE_CLIENT
  /* Display Advertisement text */
  appUiWriteString(CABLE_CLIENT_TEXT);

  /* Send diagnostic data to serial port in ASCII */
  printf("\n*** System boot ***\n");
  printf("Cable replacement client demo started\n");
  printf("The client looks for the following device: \n");
  printf(SILABS_AF_PLUGIN_CENTRAL_TARGET_DEV_NAME);
  printf("\n\nScanning...\n");
#endif /* !defined HOST && defined SILABS_AF_PLUGIN_CABLE_SERVER */
}
